home *** CD-ROM | disk | FTP | other *** search
- ;
- ; DEBUG - The worlds most powerful debugger.
- ;
- cseg segment
- assume cs:cseg,ds:cseg,es:cseg,ss:cseg
- org 0100h
- ;
- normal equ 07h
- cr equ 0dh
- lf equ 0ah
- dos equ 21h
- ;
- ddt: mov ah,33h
- mov al,0
- int dos ;get status of ctrl-c
- mov check,dl ;and save it
- mov ah,33h
- mov al,1
- mov dl,0 ;turn ctrl-c off
- int dos
- call cls ;clear screen
-
- les bx,dword ptr vidmode ;get address of mode byte in es:bx
- cmp byte ptr es:[bx],7 ;color or mono?
- mov ax,0b000h ;mono
- jz mono
- mov ax,0b800h ;color
- mono: mov word ptr ds:[scrseg],ax ;we'll save this at scrseg
-
- ;
- ; output the can and instructions
- mov si,offset can
- canlp: call writef
- cmp byte ptr ds:[si],0ffh
- jnz canlp
- ;
- ; get a key, display bits, loop. ESC to exit
- loopit: mov dx,162ah
- call set_cursor
- mov ah,0
- int 16h ;get a character
- cmp ah,01
- jnz dobits
- call cls
- mov ah,33h
- mov al,01
- mov dl,check
- int dos ;restore ctrl-c status
- mov ax,4c00h
- int dos
- ;
- ; display the bits
- dobits: mov dx,0211h
- mov cx,offset bits
- call display_string ;display bits
- mov dx,0211h
- mov cx,offset nobits ;erase bits
- call display_string
- jmp short loopit
- ;
- display_string:
- push cx
- call set_cursor
- pop dx
- mov ah,9
- int 21h
- ret
- ;
- set_cursor:
- xor bh,bh
- mov ah,2
- int 10h
- ret
-
- cls: xor cx,cx
- mov dx,184fh
- mov bh,normal
- mov ax,600h
- int 10h
- ret
-
- ;
- ; write string pointed to by DS:SI to the video display
- ; string format is:
- ; col,row,attr,'string',0
- ;
- writef: push es ;save this guy
- ; offset = (x<<1) + (y*160)
- xor ah,ah
- lodsb ;get column
- add al,al
- mov di,ax ;x*2 in di
- lodsb ;get row
- xor ah,ah
- mov dx,160
- mul dx
- add di,ax ;position in di
- lodsb ;get attribute
- mov ah,al ;to AH
- mov bx,word ptr ds:[scrseg] ;screen segment
- mov es,bx ;in ES
- write_loop:
- lodsb ;get character
- or al,al ;if 0,
- jz write_done ; we're done
- stosw ;otherwise, write char and attribute
- jmp short write_loop
- write_done:
- pop es
- ret
- ;
- ; Data area
- can:
- db 0, 1,7,' _________',0
- db 0, 2,7,' : :<<',0
- db 0, 3,7,' : :',0
- db 0, 4,7,' =============',0
- db 0, 5,7,' / \',0
- db 0, 6,7,' ===================',0
- db 0, 7,7,'| |',0
- db 0, 8,7,'| H I D D E N |',0
- db 0, 9,7,'| F L A G |',0
- db 0,10,7,'| |',0
- db 0,11,7,'| S O F T W A R E |',0
- db 0,12,7,'| "B U G" |',0
- db 0,13,7,'| K I L L E R |',0
- db 0,14,7,'| |',0
- db 0,15,7,'| WORKS |',0
- db 0,16,7,'| ON ALL | DIRECTIONS: Hold program listing to the right',0
- db 0,17,7,'| LANGUAGES! | of the screen. When ready, press',0
- db 0,18,7,'| | ANY KEY to release a powerful stream',0
- db 0,19,7,'| BITBRAIN | of bug killing bits. Some bugs may',0
- db 0,20,7,'| CHEMICALS, INC. | require repeated applications.',0
- db 0,21,7,'| NET WT. 2 Megabits|',0
- db 0,22,7,'===================== Action: ',0
- db 0ffh
-
- bits: db '101010101010101010101010101010101010101010101010101010101010$'
- nobits: db ' ',7,'$'
- check db 0 ;status of ctrl-c checking
- scrseg dw 0
- vidmode dw 1097 ;address of video mode byte
- dw 0
-
- cseg ends
- end ddt
-